\(\int \frac {\csc ^4(x)}{i+\tan (x)} \, dx\) [8]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [B] (verification not implemented)
   Sympy [F]
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 13, antiderivative size = 19 \[ \int \frac {\csc ^4(x)}{i+\tan (x)} \, dx=-\frac {1}{2} \cot ^2(x)+\frac {1}{3} i \cot ^3(x) \]

[Out]

-1/2*cot(x)^2+1/3*I*cot(x)^3

Rubi [A] (verified)

Time = 0.05 (sec) , antiderivative size = 19, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.231, Rules used = {3597, 862, 45} \[ \int \frac {\csc ^4(x)}{i+\tan (x)} \, dx=-\frac {\cot ^2(x)}{2}+\frac {1}{3} i \cot ^3(x) \]

[In]

Int[Csc[x]^4/(I + Tan[x]),x]

[Out]

-1/2*Cot[x]^2 + (I/3)*Cot[x]^3

Rule 45

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d
*x)^n, x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0]
&& LeQ[7*m + 4*n + 4, 0]) || LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 0])

Rule 862

Int[((d_) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_))^(n_)*((a_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[(d + e*x)
^(m + p)*(f + g*x)^n*(a/d + (c/e)*x)^p, x] /; FreeQ[{a, c, d, e, f, g, m, n}, x] && NeQ[e*f - d*g, 0] && EqQ[c
*d^2 + a*e^2, 0] && (IntegerQ[p] || (GtQ[a, 0] && GtQ[d, 0] && EqQ[m + p, 0]))

Rule 3597

Int[sin[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Dist[b/f, Subst[Int
[x^m*((a + x)^n/(b^2 + x^2)^(m/2 + 1)), x], x, b*Tan[e + f*x]], x] /; FreeQ[{a, b, e, f, n}, x] && IntegerQ[m/
2]

Rubi steps \begin{align*} \text {integral}& = \text {Subst}\left (\int \frac {1+x^2}{x^4 (i+x)} \, dx,x,\tan (x)\right ) \\ & = \text {Subst}\left (\int \frac {-i+x}{x^4} \, dx,x,\tan (x)\right ) \\ & = \text {Subst}\left (\int \left (-\frac {i}{x^4}+\frac {1}{x^3}\right ) \, dx,x,\tan (x)\right ) \\ & = -\frac {1}{2} \cot ^2(x)+\frac {1}{3} i \cot ^3(x) \\ \end{align*}

Mathematica [A] (verified)

Time = 0.04 (sec) , antiderivative size = 29, normalized size of antiderivative = 1.53 \[ \int \frac {\csc ^4(x)}{i+\tan (x)} \, dx=-\frac {1}{3} i \cot (x)-\frac {\csc ^2(x)}{2}+\frac {1}{3} i \cot (x) \csc ^2(x) \]

[In]

Integrate[Csc[x]^4/(I + Tan[x]),x]

[Out]

(-1/3*I)*Cot[x] - Csc[x]^2/2 + (I/3)*Cot[x]*Csc[x]^2

Maple [A] (verified)

Time = 7.68 (sec) , antiderivative size = 15, normalized size of antiderivative = 0.79

method result size
derivativedivides \(-\frac {1}{2 \tan \left (x \right )^{2}}+\frac {i}{3 \tan \left (x \right )^{3}}\) \(15\)
default \(-\frac {1}{2 \tan \left (x \right )^{2}}+\frac {i}{3 \tan \left (x \right )^{3}}\) \(15\)
risch \(\frac {4 \,{\mathrm e}^{4 i x}-2 \,{\mathrm e}^{2 i x}+\frac {2}{3}}{\left ({\mathrm e}^{2 i x}-1\right )^{3}}\) \(28\)
parallelrisch \(\frac {\left (7-4 i \cot \left (x \right )\right ) \cos \left (2 x \right )+5-4 i \cot \left (x \right )}{-12+12 \cos \left (2 x \right )}\) \(31\)

[In]

int(csc(x)^4/(I+tan(x)),x,method=_RETURNVERBOSE)

[Out]

-1/2/tan(x)^2+1/3*I/tan(x)^3

Fricas [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 36 vs. \(2 (13) = 26\).

Time = 0.24 (sec) , antiderivative size = 36, normalized size of antiderivative = 1.89 \[ \int \frac {\csc ^4(x)}{i+\tan (x)} \, dx=\frac {2 \, {\left (6 \, e^{\left (4 i \, x\right )} - 3 \, e^{\left (2 i \, x\right )} + 1\right )}}{3 \, {\left (e^{\left (6 i \, x\right )} - 3 \, e^{\left (4 i \, x\right )} + 3 \, e^{\left (2 i \, x\right )} - 1\right )}} \]

[In]

integrate(csc(x)^4/(I+tan(x)),x, algorithm="fricas")

[Out]

2/3*(6*e^(4*I*x) - 3*e^(2*I*x) + 1)/(e^(6*I*x) - 3*e^(4*I*x) + 3*e^(2*I*x) - 1)

Sympy [F]

\[ \int \frac {\csc ^4(x)}{i+\tan (x)} \, dx=\int \frac {\csc ^{4}{\left (x \right )}}{\tan {\left (x \right )} + i}\, dx \]

[In]

integrate(csc(x)**4/(I+tan(x)),x)

[Out]

Integral(csc(x)**4/(tan(x) + I), x)

Maxima [A] (verification not implemented)

none

Time = 0.22 (sec) , antiderivative size = 12, normalized size of antiderivative = 0.63 \[ \int \frac {\csc ^4(x)}{i+\tan (x)} \, dx=-\frac {i \, {\left (-3 i \, \tan \left (x\right ) - 2\right )}}{6 \, \tan \left (x\right )^{3}} \]

[In]

integrate(csc(x)^4/(I+tan(x)),x, algorithm="maxima")

[Out]

-1/6*I*(-3*I*tan(x) - 2)/tan(x)^3

Giac [A] (verification not implemented)

none

Time = 0.31 (sec) , antiderivative size = 12, normalized size of antiderivative = 0.63 \[ \int \frac {\csc ^4(x)}{i+\tan (x)} \, dx=-\frac {3 \, \tan \left (x\right ) - 2 i}{6 \, \tan \left (x\right )^{3}} \]

[In]

integrate(csc(x)^4/(I+tan(x)),x, algorithm="giac")

[Out]

-1/6*(3*tan(x) - 2*I)/tan(x)^3

Mupad [B] (verification not implemented)

Time = 4.29 (sec) , antiderivative size = 13, normalized size of antiderivative = 0.68 \[ \int \frac {\csc ^4(x)}{i+\tan (x)} \, dx=\frac {{\mathrm {cot}\left (x\right )}^2\,\left (-3+\mathrm {cot}\left (x\right )\,2{}\mathrm {i}\right )}{6} \]

[In]

int(1/(sin(x)^4*(tan(x) + 1i)),x)

[Out]

(cot(x)^2*(cot(x)*2i - 3))/6